﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Principal.Master" AutoEventWireup="true" CodeBehind="frmCoches.aspx.cs" Inherits="EncuentraWEB.Formulario_web17" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style6
        {
            width: 170px;
            height: 12px;
        }
        .style7
        {
            height: 12px;
        }
        .style8
        {
            width: 170px;
            height: 13px;
        }
        .style9
        {
            height: 13px;
        }
    </style>
     <script language="JavaScript" type="text/javascript">
<!--        //BEGIN Script

        function new_window(url) {
            var ventana = window.showModalDialog(url,"", "dialogWidth:22;dialogHeight:19;");
            var btn = document.getElementById("ctl00_ContentPlaceHolder1_btnImgFiltrar");
            if (btn) {
                btn.click();
            }
        }
        function CheckOtherIsCheckedByGVID(spanChk) {
            var Parent = document.getElementById("ctl00_ContentPlaceHolder1_grdEmpresas");
            var hidColor = document.getElementById("ctl00_ContentPlaceHolder1_hidColor");
            var hidLetra = document.getElementById("ctl00_ContentPlaceHolder1_hidLetra");
            var hidIndice = document.getElementById("ctl00_ContentPlaceHolder1_hidIndice");
            var items = Parent.getElementsByTagName('input');



            var CurrentRdbID = spanChk.id;

            //spanChk.parentElement.parentElement.style.backgroundColor
            //var anteriorLetra = spanChk.parentElement.parentElement.style.backgroundColor
            //spanChk.parentElement.parentElement.style.backgroundColor = '#738A9C';

            //spanChk.parentElement.parentElement.style.color = 'white';

            for (i = 0; i < items.length; i++) {

                if (items[i].id != CurrentRdbID && items[i].type == "radio") {

                    if (items[i].checked) {

                        items[i].checked = false;

                        items[i].parentElement.parentElement.style.backgroundColor = hidLetra.value;

                        items[i].parentElement.parentElement.style.color = hidColor.value;
                    }

                }
                else {
                    if (items[i].id == CurrentRdbID) hidIndice.value = i;
                }


            }


            var IsChecked = spanChk.checked;

            if (IsChecked) {
                var back = spanChk.parentElement.parentElement.style.backgroundColor;
                if (back != '#738a9c') {
                    hidColor.value = spanChk.parentElement.parentElement.style.color;
                    hidLetra.value = spanChk.parentElement.parentElement.style.backgroundColor;
                }
                spanChk.parentElement.parentElement.style.backgroundColor = '#738A9C';
                spanChk.parentElement.parentElement.style.color = 'white';

            }
            var Chk = spanChk;



        }






        function eliminar() {
            var hid = document.getElementById("ctl00_ContentPlaceHolder1_hidResultado");
            var res = window.confirm("Esta seguro que desea eliminar este registro?");
            if (res) hid.value = "true";
            var btn = document.getElementById("ctl00_ContentPlaceHolder1_btnImgEliminar");
            if (btn) {
                btn.click();
            }


        }
        function cambiar() {
            var hid = document.getElementById("ctl00_ContentPlaceHolder1_hidResultado");
            hid.value = "false";
        }


        function ShowEditModal(url) {
            var frame = $get('IframeEdit');
            frame.src = url;
        }
        function EditCancelScript() {
           // $find('ModalPop').hide();
         //   $find('ModalPop').TargetControlID = "btnfix";

        }
        function Refresh() {
            var btn = document.getElementById("ctl00_ContentPlaceHolder1_btnImgFiltrar");
            if (btn) {
                btn.click();
            }
        }



//END Script-->
    </script>

    <link href="Encuentra.css" rel="stylesheet" type="text/css" />
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table style="width: 100%">
        <tr>
            <td class="Separador" colspan="3">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
                        <asp:ImageButton ID="btnImgFiltrar" runat="server" ImageUrl="~/Imagenes/Botones/BotonFiltrar.gif"
                            OnClick="ImageButton4_Click" />
                    </ContentTemplate>
                </asp:UpdatePanel>
                <asp:HiddenField ID="hidResultado" runat="server" Value="false" />
                <asp:HiddenField ID="hidIndice" runat="server" />
                <asp:HiddenField ID="hidColor" runat="server" />
                <asp:HiddenField ID="hidLetra" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
            </td>
         
                    <TD >
                    <TABLE style="width: 100%;">
                      <tr>
                    <td><asp:Label ID="Label4" runat="server" CssClass="labelVentana" Text="Empresa:"></asp:Label></td>
                    <td><asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                    <asp:DropDownList ID="ddEmpresa" runat="server" AutoPostBack="True" 
                                        Width="210px" onselectedindexchanged="ddEmpresa_SelectedIndexChanged">
                                    </asp:DropDownList>
  
                                </ContentTemplate></asp:UpdatePanel></td>
                    </tr>
                    <TR>
                    <td><asp:Label ID="Label1" runat="server" CssClass="labelVentana" Text="Dominio:"></asp:Label></td>
                    <td><asp:UpdatePanel ID="UpdatePanel2" runat="server"><ContentTemplate>
                                    <asp:TextBox ID="txtDominio" runat="server" Width="210px"></asp:TextBox>
                                     </ContentTemplate></asp:UpdatePanel></td>
                    </TR>
                    
                  
                    </TABLE>
                    </td>
                    
                    </tr>
                 
        </tr>
        <tr>
       
            <td class="Separador" colspan="3">
                        <asp:ImageButton ID="btnImgAgregar" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BotonAgregar.gif"
                            OnClick="ImageButton1_Click" ToolTip="AGREGAR" />
                        <asp:ImageButton ID="btnImgEditar" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BotonEditar.gif"
                            OnClick="btnImgEditar_Click" />
                        <asp:ImageButton ID="btnImgVer" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BOTONVer.gif"
                            OnClick="ImageButton2_Click" />
                        <asp:ImageButton ID="btnImgEliminar" runat="server" CssClass="Boton" ImageUrl="~/Imagenes/Botones/BotonEliminar.gif"
                            OnClick="ImageButton3_Click" />
                               <asp:ModalPopupExtender ID="ModalPop" runat="server"   BackgroundCssClass="POP"
            CancelControlID="btnCancelar" OkControlID="btnAceptar" PopupControlID="DivEditWindow" TargetControlID="btnFix"
            oncancelscript="EditCancelScript();" BehaviorID="ModalPop">
    </asp:ModalPopupExtender>
                        <asp:Button ID="btnFix" runat="server" Text="V" Visible="true" 
                            style="display: none" />
                        <asp:ConfirmButtonExtender ID="Confirmar" runat="server" TargetControlID="btnImgEliminar" ConfirmText="Esta seguro que desea eliminar este registro?" ConfirmOnFormSubmit="True">
                        
                        </asp:ConfirmButtonExtender>
            </td>
        </tr>
        <tr>
            <td style="width: 10%">
                &nbsp;</td>
            <td >
                        <div __designer:mapid="35">
                            <asp:GridView ID="grdEmpresas" runat="server" BackColor="White" BorderColor="#E7E7FF"
                                BorderStyle="None" BorderWidth="1px" CellPadding="4" 
                                GridLines="Horizontal" Height="250px"
                                Style="margin-left: 0px" Width="848px" Font-Names="Arial" Font-Size="Medium"
                                AllowPaging="True" OnPageIndexChanging="grdEmpresas_PageIndexChanging" AutoGenerateColumns="False"
                                EmptyDataText="No se encuentra registros" 
                               >
                                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                                <Columns>
                                    <asp:TemplateField HeaderText="">
                                        <ItemTemplate>
                                            <asp:RadioButton ID="rdbGVRow" onclick="javascript:CheckOtherIsCheckedByGVID(this);"
                                                runat="server" />
                                        </ItemTemplate>
                                    </asp:TemplateField>
                                    
                                    <asp:BoundField DataField="intIdCoche" HeaderText="Id Coche" 
                                        NullDisplayText="-" />
                                    <asp:BoundField DataField="varDominio" DataFormatString="{0:d}" HeaderText="Dominio"
                                        NullDisplayText="     " />
                                    <asp:BoundField DataField="varDenominacion" DataFormatString="{0:c}" HeaderText="Denominacion" 
                                        NullDisplayText="     " />
                                    <asp:BoundField DataField="varModeloMotor" DataFormatString="{0:c}" HeaderText="Modelo Motor" 
                                        NullDisplayText="     " />
                                    
                                    
                                </Columns>
                                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" 
                                    Wrap="True" />
                                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" 
                                    Height="35px" />
                                <AlternatingRowStyle BackColor="#F7F7F7" />
                            </asp:GridView>
                        </div>
                    </td>
            <td style="width: 10%">
                &nbsp;</td>
        </tr>
    </table>
     <div id="DivEditWindow" style="display: none">
    <iframe id="IframeEdit" rameborder="0" scrolling="no" height="400" width="400">
    </iframe>
    </div>
    <div class="popup_Buttons" style="display: none">
    <input id="Button1" type="button" value="Done" />
    <input id="btnCancelar" type="button" value="Cancel"/>
    <input id="btnAceptar" type="button" value="Done" onclick="Refresh();"/>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <table style="width: 100%; height: 39px;">
        <tr>
            <td>
                <asp:Label ID="Label3" runat="server" Text="ACTUALIZACIÓN DE DATOS DE COCHES" CssClass="Titulos"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>